<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<c:if test="${orderDeclaration==null }">
	<h1 class="text-center G-MarginTop150">
		<span class="icon-frown-o"></span> 无法加载此页面
	</h1>
</c:if>
<c:if test="${orderDeclaration!=null }">
	<div class="dialog">
		<div class="dialog-head">
			<span class="close rotate-hover"></span> <strong>申报详情</strong>
		</div>
		<div class="dialog-body" id="see_order_declaration_detail_body" style="overflow-y: scroll; max-height: 600px;">


			<div id="timeline">
				<div class="timeline-item">
					<div class="timeline-icon">1</div>
					<div class="timeline-content right">
						<h2>
							财付通申报(<span class="badge bg-blue">${orderDeclaration.tenpayStatus } </span>
							<c:if test="${orderDeclaration.tenpayStatus=='待执行' }">
								<button class="people_click_tenpay_declaration_button button bg-blue" data-id="${orderDeclaration.orderId }">
									<span class="icon-send"></span> 手动申报
								</button>
							</c:if>
							)
						</h2>
						<div class="G-MarginTop10 clearfix">
							<c:if test="${orderDeclaration.tenpayCode!=null&&orderDeclaration.tenpayCode!='' }">
								<h6 class="G-MarginTop10">编码：${orderDeclaration.tenpayCode }</h6>
							</c:if>
							<c:if test="${orderDeclaration.tenpayInfo!=null&&orderDeclaration.tenpayInfo!='' }">
								<h6 class="G-MarginTop10">详情：${orderDeclaration.tenpayInfo }</h6>
							</c:if>
							<c:if test="${orderDeclaration.tenpayStartTime!=null}">
								<h6 class="G-MarginTop10">
									开始时间：
									<fmt:formatDate value="${orderDeclaration.tenpayStartTime }" pattern="yyyy-MM-dd HH:mm" />
								</h6>
							</c:if>
							<c:if test="${orderDeclaration.tenpayEndTime!=null}">
								<h6 class="G-MarginTop10">
									结束时间：
									<fmt:formatDate value="${orderDeclaration.tenpayEndTime }" pattern="yyyy-MM-dd HH:mm" />
								</h6>
							</c:if>
						</div>
					</div>
				</div>

				<div class="timeline-item">
					<div class="timeline-icon">2</div>
					<div class="timeline-content right">
						<h2>
							海关申报(<span class="badge bg-blue">${orderDeclaration.haiguanStatus }</span>
							<c:if test="${orderDeclaration.haiguanStatus=='执行成功' }">
								<button class="people_click_haiguan_declaration_button button bg-blue" data-id="${orderDeclaration.orderId }">
									<span class="icon-send"></span> 重新申报
								</button>
							</c:if>
							)
						</h2>
						<div class="G-MarginTop10">
							<c:if test="${orderDeclaration.haiguanCode!=null&&orderDeclaration.haiguanCode!='' }">
								<h6 class="G-MarginTop10">编码：${orderDeclaration.haiguanCode }</h6>
							</c:if>
							<c:if test="${orderDeclaration.haiguanInfo!=null&&orderDeclaration.haiguanInfo!='' }">
								<h6 class="G-MarginTop10">详情：${orderDeclaration.haiguanInfo }</h6>
							</c:if>
							<c:if test="${orderDeclaration.haiguanStartTime!=null}">
								<h6 class="G-MarginTop10">
									开始时间：
									<fmt:formatDate value="${orderDeclaration.haiguanStartTime }" pattern="yyyy-MM-dd HH:mm" />
								</h6>
							</c:if>
							<c:if test="${orderDeclaration.haiguanEndTime!=null}">
								<h6 class="G-MarginTop10">
									结束时间：
									<fmt:formatDate value="${orderDeclaration.haiguanEndTime }" pattern="yyyy-MM-dd HH:mm" />
								</h6>
							</c:if>
						</div>
					</div>
					<div class="timeline-content left">
						<h2>
							智检申报(<span class="badge bg-blue">${orderDeclaration.zhijianStatus }</span>)
						</h2>
						<div class="G-MarginTop10">
							<c:if test="${orderDeclaration.zhijianCode!=null&&orderDeclaration.zhijianCode!='' }">
								<h6 class="G-MarginTop10">编码：${orderDeclaration.zhijianCode }</h6>
							</c:if>
							<c:if test="${orderDeclaration.zhijianInfo!=null&&orderDeclaration.zhijianInfo!='' }">
								<h6 class="G-MarginTop10">详情：${orderDeclaration.zhijianInfo }</h6>
							</c:if>
							<c:if test="${orderDeclaration.zhijianStartTime!=null}">
								<h6 class="G-MarginTop10">
									开始时间：
									<fmt:formatDate value="${orderDeclaration.zhijianStartTime }" pattern="yyyy-MM-dd HH:mm" />
								</h6>
							</c:if>
							<c:if test="${orderDeclaration.zhijianEndTime!=null}">
								<h6 class="G-MarginTop10">
									结束时间：
									<fmt:formatDate value="${orderDeclaration.zhijianEndTime }" pattern="yyyy-MM-dd HH:mm" />
								</h6>
							</c:if>
						</div>
					</div>
				</div>

				<div class="timeline-item">
					<div class="timeline-icon">3</div>
					<div class="timeline-content right">
						<h2>
							卓志申报(<span class="badge bg-blue">${orderDeclaration.zhuozhiStatus }</span>)
						</h2>
						<div class="G-MarginTop10">
							<c:if test="${orderDeclaration.zhuozhiCode!=null&&orderDeclaration.zhuozhiCode!='' }">
								<h6 class="G-MarginTop10">编码：${orderDeclaration.zhuozhiCode }</h6>
							</c:if>
							<c:if test="${orderDeclaration.zhuozhiInfo!=null&&orderDeclaration.zhuozhiInfo!='' }">
								<h6 class="G-MarginTop10">详情：${orderDeclaration.zhuozhiInfo }</h6>
							</c:if>
							<c:if test="${orderDeclaration.zhuozhiStartTime!=null}">
								<h6 class="G-MarginTop10">
									开始时间：
									<fmt:formatDate value="${orderDeclaration.zhuozhiStartTime }" pattern="yyyy-MM-dd HH:mm" />
								</h6>
							</c:if>
							<c:if test="${orderDeclaration.zhuozhiEndTime!=null}">
								<h6 class="G-MarginTop10">
									结束时间：
									<fmt:formatDate value="${orderDeclaration.zhuozhiEndTime }" pattern="yyyy-MM-dd HH:mm" />
								</h6>
							</c:if>
						</div>
					</div>
				</div>
			</div>
		</div>
		<div class="dialog-foot">
			<button class="button dialog-close">关闭</button>
		</div>
	</div>
</c:if>
<script type="text/javascript">
	$(".people_click_tenpay_declaration_button").each(function()
	{
		var button_obj = $(this);
		button_obj.click(function()
		{
			$.ajax(
			{
				url : "admin/m_people_tenpay_declaration_do",
				type : "POST",
				dataType : "json",
				beforeSend : function(XMLHttpRequest)
				{
					button_obj.attr("disabled", "disabled");
				},
				data :
				{
					'orderId' : button_obj.attr("data-id")
				},
				success : function(json, textStatus)
				{
					if (json.success == true)
					{
						alert("手动执行成功，请刷新页面查看结果。");
						button_obj.remove();
					}
					else
					{
						alert(json.info);
					}
				},
				error : function(XMLHttpRequest, textStatus, errorThrown)
				{
					alert("提交失败，请仔细检查您的输入是否满足要求。");
				},
				complete : function(XMLHttpRequest, textStatus)
				{
					button_obj.removeAttr("disabled");
				}
			});
		});
	});
	$(".people_click_haiguan_declaration_button").each(function()
	{
		var button_obj = $(this);
		button_obj.click(function()
		{
			$.ajax(
			{
				url : "admin/m_people_cancel_haiguan_declaration_do",
				type : "POST",
				dataType : "json",
				beforeSend : function(XMLHttpRequest)
				{
					button_obj.attr("disabled", "disabled");
				},
				data :
				{
					'orderId' : button_obj.attr("data-id")
				},
				success : function(json, textStatus)
				{
					if (json.success == true)
					{
						alert("重新申报成功，请刷新页面查看结果。");
						button_obj.remove();
					}
					else
					{
						alert(json.info);
					}
				},
				error : function(XMLHttpRequest, textStatus, errorThrown)
				{
					alert("提交失败，请仔细检查您的输入是否满足要求。");
				},
				complete : function(XMLHttpRequest, textStatus)
				{
					button_obj.removeAttr("disabled");
				}
			});
		});
	});
</script>